fix NaN and report.distance