fixed sync functionality