[Fix] - Sort keys for the inorder of output records