fixed bug in paging