fix multithread