fixed end_date bug