     
     #clear textbox and update suggestion filter
     Session.get('tag_input_box')?.value = ''
-    Session.set("filter_text", '')
+    Session.set('filter_text', '')
     if tag_text != "" && not (tag_text in my_tags)
       my_tags.push(tag_text)
       Posts.update(id, {$set: {'my_tags': my_tags}})

    
  suggested_tags: ->
    filtered = []
    for tag in Session.get("suggested_tags")
      if tag? && tag.search(Session.get("filter_text")) != -1
        filtered.push(tag)
    return { suggested: true, tags: filtered }

  tagging_post: -> Session.equals("current_post", @_id)
  
  events: {
    

    
    "click button[name='start_tagging']": (event) ->
      if not event.isImmediatePropagationStopped()
        Session.set('current_post', @_id)
        Session.set('suggested_tags', @suggestions)
        Session.set('filter_text', '')
        Session.set('tag_input_box', undefined)
        event.stopImmediatePropagation()
        
    "click button[name='enter_tag']": (event) ->
      if not event.isImmediatePropagationStopped()
        Template.tagbox.add_tag(@_id, @my_tags,
          Session.get('filter_text'))
      return false
        
    "click button[name='done_tagging']": (event) ->
      if not event.isImmediatePropagationStopped()
        Session.set('current_post', undefined)
      return false
  }
  
