tail rec for worker
merge and rollback