     /// - Parameters:
     ///   - data: the bookMark data
     ///   - appScoped: if set to true it is an app-scoped bookmark else a document-scoped bookmark
+    ///   - forKey: the key (in case of error the bookmark will be destroyed)
     /// - Returns: the securizedURL
     /// - Throws: SecurityScopedBookMarkError
-    internal func _getSecurityScopedURLFrom(_ data: Data, appScoped: Bool=false)throws -> URL {
+    internal func _getSecurityScopedURLFrom(_ data: Data, appScoped: Bool=false, forKey:String)throws -> URL {
         var bookmarkIsStale: Bool = false
         do {
             #if os(OSX)

            if (!bookmarkIsStale) {
                return securizedURL!
            } else {
                throw SecurityScopedBookMarkError.bookMarkIsStale
            }
        } catch {
            throw SecurityScopedBookMarkError.getScopedURLRessourceFailed(message: "\(error)")
        }
    }

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