better threadComplete detection