fix setting of environment variables