fixed javascript loading issue