added pagination for index page