fixed a pagination related bug