better end-date handling