fix misuse of getenv()