added pagination to the index view