Synchronous the threads: replace multi thread with single thread.