Working on fixing data races in multithreaded code