added pagination to index