Added close to sql functions