- handle exit event