Fixed search select issue and took into account private pies when calculating total pages