fixed sync bugs