add exit button functionality.