Fix check for environment variable