                     {
                         while (wifly.available() > 0)
                         {
-                            int data = wifly.read();
+                            int data = wifly.read();                            
 
                             // If first character back from remote side is NVT_IAC, we have a telnet connection.
-                            if (isFirstChar) 
-                            {
+                            if (isFirstChar) {
                                 if (data == NVT_IAC)
                                 {
                                     isTelnet = true;
-                                    CheckTelnetInline();
                                 }
                                 else
                                 {
                                     isTelnet = false;
                                 }
-                                isFirstChar = false;
+                            }
+                                                                                  
+                            if (data == NVT_IAC && isTelnet)
+                            {
+                                if (baudMismatch)
+                                {
+                                    digitalWriteFast(WIFI_CTS, LOW);        // re-enable data
+                                    if (CheckTelnetInline())
+                                        buffer[buffer_index++] = NVT_IAC;
+                                    digitalWriteFast(WIFI_CTS, HIGH);     // ..stop data from Wi-Fi
+                                }
+                                else
+                                {
+                                    if (CheckTelnetInline())
+                                        C64Serial.write(NVT_IAC);
+                                }
                             }
                             else
                             {
-                                  if (data == NVT_IAC && isTelnet)
-                                  {
-                                      if (baudMismatch)
-                                      {
-                                        digitalWriteFast(WIFI_CTS, LOW);        // re-enable data
-                                        if (CheckTelnetInline())
-                                            buffer[buffer_index++] = NVT_IAC;
-                                        digitalWriteFast(WIFI_CTS, HIGH);     // ..stop data from Wi-Fi
-                                    }
-                                    else
-                                    {
-                                        if (CheckTelnetInline())
-                                            C64Serial.write(NVT_IAC);
-                                    }
-  
+                                if (baudMismatch)
+                                {
+                                    digitalWriteFast(WIFI_CTS, HIGH);     // ..stop data from Wi-Fi
+                                    buffer[buffer_index++] = data;
                                 }
                                 else
                                 {
-                                    if (baudMismatch)
-                                    {
-                                        digitalWriteFast(WIFI_CTS, HIGH);     // ..stop data from Wi-Fi
-                                        buffer[buffer_index++] = data;
-                                    }
-                                    else
-                                    {
-                                        DoFlowControlModemToC64();
-                                        C64Serial.write(data);
-                                    }
-                               }
+                                    DoFlowControlModemToC64();
+                                    C64Serial.write(data);
+                                }
                             }
+                            
+                           
                         }
-
                         if (baudMismatch)
                         {
                             // Dump the buffer to the C64 before clearing WIFI_CTS

            case 'Z':   // ATZ
                Modem_LoadSavedSettings();
                if (wifly.isSleeping())
                    wake();
                break;

            case 'I':   // ATI

    int inpint, verbint, optint;                        //    telnet parameters as integers
       
    // First time through
    if (isFirstChar) {
        SendTelnetParameters();                         // Start off with negotiating
        isFirstChar = false;
    }
    
    verbint = ReadByte(wifly);                          // receive negotiation verb character
    
