added ValueError exception when date is invalid