correcting drienvironment logic