fixed bug with paging