fixed thread synchro bug