updated env var handling