added validation checks for dates