rhhayne spireland fixes row indices when sorting and selecting with buttons