fix whole sync bugs