fix script loaded callback bug