change index page into pagination