                                         @connections.push connection
                                         @listenForMessage connection
 
-                connection.on "close", =>
-                    if @selfUnmount
-                        alert "selfUnmount"
-                        return
-
-                    @addNotice "Founder left the channel!"
-                    @setState channelActive: false
+                                        connection.on "close", @connectionClose
+
+                    connection.on "close", =>
+                        if @selfUnmount
+                            return
+
+                        @addNotice "Founder left the channel!"
+                        @setState channelActive: false
 
                 @peer.on "connection", (connection) =>
                     connection.on "open", =>

                        @listenForMessage connection

                        @addNotice "Someone joined the channel..."

    componentWillUnmount: ->
        @selfUnmount = true


                        @addNotice "Someone joined the channel..."

                    connection.on "close", @connectionClose

            if not isFounder
                @props.addAlert type: "success", "You just joined to an existing channel! You are a peer."

