Fixed a bug in the pagination with an incorrect model