fixed error with date ranges