Moved <script> at bottom of template