check if previousIndex == -1