add mainthread event loop