bug: $earliestTime is not defined.