fixed date indexing bug