make sure session gets closed