bug fix of index