Fixed type error finding avg of dates