move js code to end of head tag