Check for the env variable for better compatibility