     if magnet? && magnet.length > 0
       dbg 'Adding magnet/hash ' + magnet
       $rootScope.client.processing = true
-      $rootScope.client.add magnet, opts, onTorrent || $rootScope.onTorrent
+      $rootScope.client.add magnet, onTorrent || $rootScope.onTorrent
 
   $rootScope.destroyedTorrent = (err) ->
     if err

        opts.name = name
      $rootScope.client.processing = true
      $rootScope.client.seed files, opts, $rootScope.onSeed
      delete opts.name

  $rootScope.openTorrentFile = (file) ->
    if file?
      dbg 'Adding torrent file ' + file.name
      $rootScope.client.processing = true
      $rootScope.client.add file, opts, $rootScope.onTorrent

  $rootScope.client.on 'error', (err, torrent) ->
    $rootScope.client.processing = false

    duration: 2000
    html: true

  onTorrent = (torrent) ->
    $rootScope.viewerStyle = {'margin-top': '-20px', 'text-align': 'center'}
    dbg torrent.magnetURI
    torrent.safeTorrentFileURL = torrent.torrentFileBlobURL
