fixed synchronization bugs