         do {
             try fileManager.removeItem(atPath: audioFile!.url.absoluteString)
         } catch let error as NSError {
-            AKLog("AKNodeRecorder Error: cannot delete Recording file:  \(audioFile!.fileNamePlusExtension)")
+            AKLog("AKNodeRecorder Error: cannot delete Recording file: \(audioFile?.fileNamePlusExtension)")
             throw error
         }
 


        // AVAudioSession buffer setup

        if file == nil {
            // We create a record file in temp directory
            do {
                internalAudioFile = try AKAudioFile()

                AKLog("AKNodeRecorder Error: Cannot create an empty audio file")
                throw error
            }
            self.node = node
            return
        }

        do {
            // We initialize AKAudioFile for writing (and check that we can write to)
            internalAudioFile = try AKAudioFile(forWriting: existingFile.url,
                                                settings: existingFile.processingFormat.settings)
        } catch let error as NSError {
            AKLog("AKNodeRecorder Error: cannot write to \(existingFile.fileNamePlusExtension)")
            throw error
        }

        self.node = node
    }

