pass env variables to popen, rather than setting them globally