fix sync bugs