cleanup `do-query`