handle no matches
fix a typo in serialization, and forgot to sort results