fixed a index bug