moved controls to env
trying to add some debug messages but there is error