Dynamically adding it like that does sound like the best way. Thanks for pointing out the initial issue as I probably wouldn’t have noticed it myself (plus this is older code by now), as well as the caching suggestion.
I’ll push an update for this in the near future. There’s a few other changes that I’ve been meaning to make regarding handling outdated modules and automatic updates.