5298 18 pagination

Fixes issue #5298