added pagination to newIndex