multithread fix