- added check for valid date