fix threadid extraction