splitting the pagination and add the links