Corrected multithreading