diff --git a/src/ui/interactivesimulation/JFrameInteractiveSimulation.java b/src/ui/interactivesimulation/JFrameInteractiveSimulation.java
index 264591805d235a7cd6c3adf458cd003fb50cbeae..b60ddecdb85710778044210648d2a51713918812 100755
--- a/src/ui/interactivesimulation/JFrameInteractiveSimulation.java
+++ b/src/ui/interactivesimulation/JFrameInteractiveSimulation.java
@@ -1074,6 +1074,8 @@ public  class JFrameInteractiveSimulation extends JFrame implements ActionListen
             }
         }
         mgui.resetRunningID();
+		mgui.resetStatus();
+		mgui.resetTransactions();
         mgui.resetLoadID();
         mgui.setDiploAnimate(false);
         dispose();
diff --git a/src/ui/window/JDialogSystemCGeneration.java b/src/ui/window/JDialogSystemCGeneration.java
index 0f826ecb8c193978f771e43f00df001cca5b20b8..07c462a43de9439575eada351545226e05fa3497 100755
--- a/src/ui/window/JDialogSystemCGeneration.java
+++ b/src/ui/window/JDialogSystemCGeneration.java
@@ -125,7 +125,7 @@ public class JDialogSystemCGeneration extends javax.swing.JDialog implements Act
     protected final static int NOT_STARTED = 1;
     protected final static int STARTED = 2;
     protected final static int STOPPED = 3;
-
+	protected final static int ERROR=4;
     int mode;
 
 
@@ -865,8 +865,14 @@ public class JDialogSystemCGeneration extends javax.swing.JDialog implements Act
         // Command
         try {
             processCmd(cmd, jta);
+			if (jta.getText().contains("Error ")){
+				mode = ERROR;
+				setButtons();
+				return;
+			}
             //jta.append(data);
             jta.append("Compilation done\n");
+
         } catch (LauncherException le) {
             jta.append("Error: " + le.getMessage() + "\n");
             mode =      STOPPED;
@@ -953,13 +959,16 @@ public class JDialogSystemCGeneration extends javax.swing.JDialog implements Act
         String s = null;
         rshc.sendProcessRequest();
         rshc.fillJTA(_jta);
+		//if (
         //s = rshc.getDataFromProcess();
         //return s;
         return;
     }
 
     protected void checkMode() {
-        mode = NOT_STARTED;
+		if (mode!=ERROR){
+        	mode = NOT_STARTED;
+		}
     }
 
     protected void setButtons() {
@@ -980,6 +989,12 @@ public class JDialogSystemCGeneration extends javax.swing.JDialog implements Act
                 //setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                 break;
             case STOPPED:
+				break;
+			case ERROR:
+				start.setEnabled(false);
+				stop.setEnabled(false);
+				close.setEnabled(true);
+				break;
             default:
                 start.setEnabled(false);
                 stop.setEnabled(false);