replace safeClose with just close