added date validation to display error if date is in the past.