NaN problem with duration