[FIX] kanban: wrong condition to reset the dataset index

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