fix some sync bugs