fixes date formating when the date is null