fixed change_index bug