rewrote event queue using lock and condition