diff --git a/reading_machine/src/Transition.cpp b/reading_machine/src/Transition.cpp
index 47ecca46eb8d5916ebc7d4494cad950bdb12e2a4..a50d38aa349c7d09656cdcf749ee856735acab9a 100644
--- a/reading_machine/src/Transition.cpp
+++ b/reading_machine/src/Transition.cpp
@@ -101,14 +101,14 @@ void Transition::apply(Config & config, float entropy)
 {
   if (config.hasColIndex("STACK_SIZE"))
   {
-    auto & curValue = config.get("STACK_SIZE", config.getWordIndex(), 0);
-    if (std::string(curValue).empty())
+    auto & curValue = config.getLastNotEmptyHyp("STACK_SIZE", config.getWordIndex());
+    if (std::string(curValue).empty() and config.getState() == "parser")
       curValue = fmt::format("{}", config.getStackSize());
   }
   if (config.hasColIndex("STACK_DIST"))
   {
-    auto & curValue = config.get("STACK_DIST", config.getWordIndex(), 0);
-    if (std::string(curValue).empty())
+    auto & curValue = config.getLastNotEmptyHyp("STACK_DIST", config.getWordIndex());
+    if (std::string(curValue).empty() and config.getState() == "parser")
     {
       if (config.hasStack(0) and config.hasStack(1))
         curValue = fmt::format("{}", config.getStack(0) - config.getStack(1));