event queue logic worked out