fix pagination overflowing