         if not @activated
 
 
+            # initializations
+            log 'IM', 'activated'
             @startPosition = @core.editor.getCursorBufferPosition()
-            log 'IM', 'activated'
             @inputBuffer = ''
             @outputBuffer = ''
+            @decorator.show()
             @activated = true
-            @decorator.show()
 
             # monitors raw text buffer and figures out what happend
             @textBufferMarker = @core.editor.markBufferRange(new Range @startPosition, @startPosition)
-            @textBufferMarker.on 'changed', @analysisEvent
+            @textBufferMarker.on 'changed', @dispatchEvent
 
             # insert '\' at the cursor
             @updateOutputBuffer '\\'

    outputBuffer: ''
    # mark the starting position of the input buffer when activated
    startPosition: null


    @trie: require './input-method/keymap.js'


    updateOutputBuffer: (text) ->

        # update text buffer
        @muteEvent =>
            @core.editor.getBuffer().delete @getRange()
            @core.editor.getBuffer().insert @startPosition, text

        # update output buffer
        @outputBuffer = text
