index bug fixed