improve detection on several environments