fix env name and support env vars