move js loading to the end of the document