adding event loop