fixed the synchronization problem