         else
           warn "there was a problem fetching default tags!", err, tags
     
-
-  
 class SkillTagAutoCompletedItem extends KDAutoCompletedItem
   constructor:(options, data)->
     options.cssClass = "clearfix"

    super
  
  putDefaultValues:(stringTags)->
    bongo.api.JTag.some
      title     :
        $in     : stringTags

    @memberData.skillTags or= []
    
    @setCallback (formData)=>
      if formData.skillTags?
        newTags      = formData.skillTags?.filter((tag)-> tag.$suggest?)
        oldTags      = formData.skillTags?.filter((tag)-> tag.id?)
        plainNewTags = newTags.map((tag)-> tag.$suggest)
        plainOldTags = oldTags.map((tag)-> tag.title)

        joinedTags   = plainNewTags.concat plainOldTags

        # log newTags, oldTags, joinedTags
        @memberData.addTags 'skillTags', newTags, (err)=> 
          if err
            log "An error occured:", err
          else
            changes = $set:
              'skillTags' : joinedTags
            @memberData.update changes, (err)=>
              if err
                log err
                new KDNotificationView
                  title : "There was an error updating your profile."
              else 
                @memberData.emit "update"
                new KDNotificationView
                  title     : "Success!"
                  duration  : 500
                @unsetClass 'active'

  showForm:->
    unless @$().hasClass "active"
