added event loop and set