updated to getenv to stop KeyError