this callback should be wrapped in a runloop.