Added a check to make sure the end date is after the start date.