waiting for event to be set