manually detect enter and exit regions