new query decoding