fixed a memory leak with joinable thready