fixed javascript loading bugs with .load() instead of .ready()