fix some nasty sync bug