adjusts the js load order to fix a loading glitch