put setEnvironment back in for testing purposes