destroys gui when exiting via escape