added enviro check