Multithreading issues finally fixed