Bug fix: hand over correct evironment