Changed the control of pagination.