Updated env var handling