move js file loading to the end of the dom