exit button implementation