use consistent env fetching. #531