fix query composition