added env check