Adding support for pagination