detecting env