fix isPast() function