     }
     
     while cursor != string.endIndex {
-        let (_key, afterKey) = _parseString(string, index: cursor)
+        let (_key, afterKey, err) = _parseString(string, index: cursor)
         guard let key = _key else {
             // parse key error, invalid json
-            return (JSON(), cursor)
+            return (.None(err), cursor)
         }
         cursor = afterKey
         let (token1, tokenIndex) = nextToken(string, index: cursor)

    
    guard cursor.distanceTo(string.endIndex) > 4 else {
        // invalid json
        return (JSON(), cursor)
    }
    
    if  string[cursor] == "f" 

            string.append(comma)
        }
        // remove last comma
        if array.count > 0 {
            string.removeAtIndex(string.endIndex.advancedBy(-1))
        }
        string.append(close)
        return  
    }
