adjust callback nesting in torrent.js