Use safe close.