Fix multithread