added support for paging