finished the pagination