fix bug by multithread