Added ability to set an environment