Better checking of previous loads in loadScript()