Fixed the pagination problem (or so I hope) by partially rewritten the used function call.