fix query output