fixing up the retval for thread being joined