Fixed a bug caused by passing the log object to the threads