updating enviroment detection