fixed crash index bug