add sorting to the client