The dataset index should be reset either if the dataset is empty or the index is greater than the records size