added the pagination and render the records