Fix Quit Event Handling