avoid NaN errors when calculating line times