fixed isBefore