Add option to run event loop once