Added closing of session