added pagination to the index