Fix end_date bug