getEnvironment bug fix