core-4936 fix paging logic