modified how scripts are handled