fix use of environment variables