UPDATE creating a loadScript function