fixing the env variable handling