take event loop as first param instead of function