offset/numberOfRecords logic fixed