resetting the page index is messing things up