a bug fix in the pagination