added sorting mechanism for comments to server