fix end date bug