leave/enter fix