add duration support to latest function