bugfix with environment