fixed a bug with paging