implemented exit button.