fixed bug in synchronization