Why are you casting an InstanceScript* to InstanceScript* ?