client was missing an else branch for a quries without sorting, also there was one typo fixed there