indexing bug fix