move javascript to before ending body tag