fix bug: set initial index doesn't set index.