fix pagination direction