deal with the case where T is given with NaN's