diff --git a/src/capture/capture_base.cpp b/src/capture/capture_base.cpp
index a8d5f502eed347c722321651b96fe0dbf1501719..ef0f89d47ff78c447f81cbd9423b32e755f6e8bc 100644
--- a/src/capture/capture_base.cpp
+++ b/src/capture/capture_base.cpp
@@ -224,6 +224,8 @@ void CaptureBase::setProblem(ProblemPtr _problem)
     if (_problem == nullptr || _problem == this->getProblem())
         return;
 
+    assert(getFrame() and getFrame()->isKey());
+
     NodeBase::setProblem(_problem);
     registerNewStateBlocks(_problem);