move js code to top