Close the query modal