moved loading of '.js' file to end of page, to ensure query is loaded first