fixing the env check