Small fix to the multithreading functionality