Initialize index with start_index before using it