fix pagination issues