potential end date out of range bug fix