index bug fix