public void run() {
        StringBuilder tmpmessage = new StringBuilder();
        int max_waitdata = 10;
        
        try {
            if (in == null) {
                return;
            }
            // old fashion lead to error;
            //  wait for channel ready
            InputStreamReader tmpin= new InputStreamReader(in);
            InputStreamReader tmperr = new InputStreamReader(err);
            
            while ( max_waitdata > 0 && ! tmpin.ready() ) {
                // no data and not in timeout 
                try { Thread.sleep( 100 ); }catch( Exception ee ) {}
                max_waitdata--;
            }
            
            BufferedReader myfile = new BufferedReader(tmpin);
            BufferedReader myerror = new BufferedReader(tmperr);
            
            mysar.parse(myfile);
            String current_line;
            
            while ( (current_line = myerror.readLine()) != null) {
                tmpmessage.append(current_line);
                tmpmessage.append("\n");
            }
            if ( tmpmessage.length() >0 ) {
                if ( GlobalOptions.hasUI()) {
                    JOptionPane.showMessageDialog(GlobalOptions.getUI(), tmpmessage.toString(),"SSH error", JOptionPane.ERROR_MESSAGE);
                }
            }
            myfile.close();
            myerror.close();
            tmpin.close();
            tmperr.close();
            in.close();
            err.close();
            channel.disconnect();
            session.disconnect();
            channel=null;
            session=null;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return;
    }