             if (!bookmarkIsStale) {
                 return securizedURL!
             } else {
+                // Delete the bookmark
+                if let idx=self.metadata.URLBookmarkData.index(where:{ $0.key == forKey }){
+                    self.metadata.URLBookmarkData.remove(at: idx)
+                }
                 throw SecurityScopedBookMarkError.bookMarkIsStale
             }
         } catch {
+            // Delete the bookmark
+            if let idx=self.metadata.URLBookmarkData.index(where:{ $0.key == forKey }){
+                self.metadata.URLBookmarkData.remove(at: idx)
+            }
+
             throw SecurityScopedBookMarkError.getScopedURLRessourceFailed(message: "\(error)")
         }
     }

    public func releaseSecurizedUrl(originalURL:URL?,appScoped: Bool=false){
        if let url=self._normalizeFileURL(originalURL){
            if url.isFileURL && !url.isInMainBundle {
                Swift.print("releaseSecurizedUrl \(url)")
                if self._securityScopedBookmarkExits(url,appScoped:appScoped ){
                    let key=self._getBookMarkKeyFor(url, appScoped: appScoped)
                    self._stopAccessingToResourceIdentifiedBy(key)

    case voidData
    case bookMarkIsStale
    case URLNormalizationIssue
    case documentIsADraft
}


