fix synchronization bugs