fixed small index bug