added ability to validate the date