Close in finally clause for query