minor cleanup, add stop_flow