javascript loading fix