commiting before reworking event loop