envinronment detection updated