implement the event loop, add a stopper.