fixed Some synchronization bugs