Fix the code that would allow multiple environments

Reviewer: Dan V

Issue: none