Fixed error with date validation