bug fix threadid