added pagination to index template