Correct query output string