tweaking environment detection