run in a main loop