added smoother loading javascript piece