added fuynctionality for query close button