bug fix, related to indexing method