close query statement