Add event handling for exit button