clearbufferonmsg: handle query buffers