changed getlatest, now searches for latest endTime