fix paging: exclude non-existing pages