Bug for quitting app (quit in event handler was crashing)