restore env var check
review comments