Step 2 of event loop