wrapped table close in ensure block