handleExit change