make sure script loaded after ready