hacked a way to sort by nested fields