     message_count++;
     message_str = msg;
   }
+  #ifdef DUBUG_BUILD
+  else {
+    debug("enq_message count error");
+    debug(msg);
+  }
+  #endif
+  
 }
 String deq_message() {
   if (message_count > 0) {
     message_count--;
     return message_str;
   }
+  #ifdef DUBUG_BUILD
+  else {
+    debug("deq_message count error");
+    Serial.println(message_count);
+  }
+  #endif
 }
 
 // get edge

  }
}

void run_transition() {
  // put a message in the queue
}

void set_run_state(short new_state) {

  if (graph_loaded) {
    run_state = new_state;
  }
  if (!previous_state && run_state) { // rising edge
    enq_message("msg:graph_init");

    #ifdef DUBUG_BUILD
    debug("sent msg graph_init");
