added pagination to the index page