moved up so no error is returned for environment_id doesn't exist