diff --git a/app/corpora/cqi/models/attributes.py b/app/corpora/cqi/models/attributes.py
index 754646cc3104f7c7b686c6d2fce6cce22e94f6ee..152a6f62446cc1d7728c2f78aebee2631c3cd424 100644
--- a/app/corpora/cqi/models/attributes.py
+++ b/app/corpora/cqi/models/attributes.py
@@ -140,7 +140,7 @@ class StructuralAttribute(Attribute):
             rc_rbound = \
                 self.cpos_by_id(min((last_id + context), (self.size - 1)))[1]
             if rc_rbound != last_cpos:
-                rc_lbound = min((last_cpos + 1), (self.size - 1))
+                rc_lbound = min((last_cpos + 1), (self.corpus.size - 1))
                 rc = (rc_lbound, rc_rbound)
                 cpos_list_rbound = rc_rbound
             else: