fix check for environment