public void stop(){
        
        try {
            
            // remove from each channel
            //for (int i = 0; i<channels.length;i++){
            //    handler.removeUserFromChannel(nickname, handler.returnChannel(channels[i]).getChannelName());
            //}
            
            
            computerName = "";
            ipaddress = "";
            loggedName = "";
            nickname = "";
            
            in.close();
            out.close();
            socket.close();
            
            log.writeLn("Closing socket");
            socket = null; // to show it is not runing
            thread.stop();
            
        } catch (IOException ex) {
            log.writeErr("Error stopping client thread: " + index);
        } finally {
            thread.stop();
        }
        
    }