Fixed how javascript files are loaded