 
         stream = {
           id: id
+          mid: id
           index: index
           nice: nice_stream
           needs_ice_cred: true
         }
 
-        @streams[m[1]] = stream
+        @streams[index] = stream
 
         # send candidates when gathered
         # TODO: move to trickling ...


        rtp_types = rtp_types.concat(parseInt(type) for type in types.split(" "))

      else if m = line.match(/a=ice-ufrag:(.*)/)
        # replace and apply ufrag
        stream.ufrag = m[1]

    if candidate.indexOf("a=") != 0
      candidate = "a=" + candidate

    @streams[index]?.nice?.addRemoteIceCandidate candidate

  close: () ->
    console.log 'closing echo'
