add a basic flow-control in syncing, so we can send notification when is done. rework on this and do it in parallel