Fix endate issue