adds support for the new environment flag