multithreading fixes