fixed bug in end date