           $('#'+connectedusercolor.substr(1)).css('color',connectedusercolor);
           $('#'+connectedusercolor.substr(1)).text(connecteduser);
 
-
+        @userref.on 'child_removed', (snapshot) =>
+          console.log(snapshot)
+          user = snapshot.val();
+          connecteduser = snapshot.name()
+          connectedusercolor = snapshot.val().color;
+          $('#'+connectedusercolor.substr(1)).remove();
 
 
 

    @coderef = @ref.child('code');
    @userref = @ref.child('users');
    @chatref = @ref.child('chat');

    @coderef.once 'value', (snapshot) =>
        options = {sv_: Firebase.ServerValue.TIMESTAMP}

        @view = new ColabView(codekey[1],@getFilename())
        @view.show()

        #stop collab button
        $('#stopCollab').on 'click', =>
          @stop()

        #@initStatistics

        #read only button
        $('#readonlycheckbox').on 'click', =>
          console.log($('#readonlycheckbox')[0].checked)
          @readonlyref.set($('#readonlycheckbox')[0].checked);

        #Lets add the comment stating where the collaboration is being done online
        #comment = @getColabComment(@getLanguage(),codekey[1])
        #editor.setText comment+editor.getText()
        @readonlyref.on 'value',(snapshot) =>
          $('#readonlycheckbox')[0].checked = snapshot.val()

        @chatref.on 'child_added', (snapshot) =>
          chattext = snapshot.val().text
          chatuser = snapshot.val().user
