fix env variable configuration logic