Fixed crashing due to corrupt event queue

Fixed main loop event queue