fix threadbuffer