adding pagination to the index