adding env variable checks