Moved js files to top of page, does not work otherwise