Fixing improper check if an env var has been set