polish the sync functionality