         // update fileOffset
         
         let firstChar = "X"
-        var data : NSData! = firstChar.dataUsingEncoding(NSUTF8StringEncoding)
+        let data : NSData! = firstChar.dataUsingEncoding(NSUTF8StringEncoding)
         
         // TRUE if the operation succeeds, otherwise FALSE.
-        return data.writeToURL(self.url, options: .DataWritingAtomic , error: &self.error)
+        // TODO ERROR HANDLING
+        do {
+            try data.writeToURL(self.url, options: NSDataWritingOptions.DataWritingAtomic)
+        } catch {
+            return false
+        }
+        
+        return true
     }
     
     // subclasses should overide this method

        }
        
        if !errorOccurred {
            fileHandle = NSFileHandle(forUpdatingURL: url, error: &self.error)
        }
        
        if fileHandle != nil {

    
    public func addObject(aObj: O) -> UID {
        
        let pos = registerBlock()
        let uid = calculateID(pos)
        
        self.writeBlock(aObj, atPos: pos)
        
