Changed operation of exit button