fixed javascript loading problem