Fixed bug in paging