implement support for calling preload when the script changes