fixed case of multithreads