added condition for environment variable