change behaviour when processing sort, save the key and do the sorting
while exporting to the records file