take sortKey into account