add savequery if querywindow will be closed by X