added ability to dynamically change environments