added quick fix for output of sort queries