add multithreading sync