added sorted to return queue to client