Index: trunk/FACT++/src/LocalControl.h
===================================================================
--- trunk/FACT++/src/LocalControl.h	(revision 16383)
+++ trunk/FACT++/src/LocalControl.h	(revision 16387)
@@ -120,9 +120,8 @@
             const Time timeout = ms<=0 ? Time(Time::none) : Time()+boost::posix_time::millisec(ms);
 
-            const int target = stoi(str.substr(3));
-            while (fStateMachine->GetCurrentState()!=target && timeout>Time() && !T::IsScriptStopped())
+            while (fStateMachine->GetCurrentState()!=state && timeout>Time() && !T::IsScriptStopped())
                 usleep(1);
 
-            if (fStateMachine->GetCurrentState()==target)
+            if (fStateMachine->GetCurrentState()==state)
                 return true;
 
