Fix invalid enddate exception