improve multithreading stability