add closeQuietly method.