Reimplemented the event queue.