       addTab: (name) ->
         {tabs} = uploadcare.widget
 
-        selectedFileCallback = @fileSelected.bind(this)
-        
         tabCls = switch name
           when 'file' then tabs.FileTab
           when 'url' then tabs.UrlTab

          .hide()
          .appendTo('body')

        closeCallback = => @close()

        @content.on 'click', (e) ->
          e.stopPropagation()
          closeCallback(e) if e.target == e.currentTarget

        closeButton = @content.find('@uploadcare-dialog-close')
        closeButton.on 'click', closeCallback

        $(window).on 'keydown', (e) ->
          closeCallback(e) if e.which == 27 # Escape

        @tabs = {}
        for tabName in @tabNames when tabName not of @tabs


        return false if not tabCls

        tab = new tabCls this, @settings, @fileSelected.bind(this)

        if tab
          $('<li>')
