fixes problems with loading js files