move <script> tags to proper location just before </body> tag