fix bug of pagination and number of rows.