Added onLeave method that's called before the menu is actually left.
onExit is called after the menu has been left.