added wait for event queue to focus() call