Added check for env var