Updated environment handling

small change