console environment detection fixed