       switch event.name
         when "cursors"
           id = event.object.author
-          index = @characters.indexOf event.object.char
+          index = (@get "characters").indexOf event.object.char
           text = event.object.author
           color = "grey" # FIXME
 
           if event.type == "update" or event.type == "add"
             @editor.cursors.setCursor id, index, text, color
 
-
         when "characters"
-          charPos = @characters.indexOf event.object
+          charPos = (@get "characters").indexOf event.object
           delta = {ops: [{retain: charPos}]}
           del = {delete: 1}
           ins = {insert: event.object.char, attributes: event.object.attributes}

          @editor.setContents delta

        when "selections"
          selectionStart = @characters.indexOf (event.object.left or event.oldValue.left)
          selectionEnd = @characters.indexOf (event.object.right or event.oldValue.right)
          attributes = event.object.attributes
          if event.type == "update" or event.type == "insert"
            delta = {ops: [{retain: selectionStart},


  setCursor: () ->
    if @editor.getSelection()
      position = (@get "characters").val @editor.getSelection().start
    else
      position = (@get "characters").val 0

    selfCursor =
      author: @author
