Fixed bug with loading javascripts