diff --git a/robopy/base/serial_link.py b/robopy/base/serial_link.py
index 6ed4665c82bcab3893161fc6c1842ef831a05dcd..1c76fb72f6eed4d7435c42102bb710857b83d0e9 100644
--- a/robopy/base/serial_link.py
+++ b/robopy/base/serial_link.py
@@ -142,7 +142,7 @@ class SerialLink:
         """
         assert type(T) is np.matrix and T.shape == (4, 4)
         assert mask.shape == (6,), 'The mask must have 6 elements'
-        assert mask.sum() == self.length, 'The mask must have equal amount of 1s as the degrees of freedom of the kinematic chain'
+        assert mask.sum() == min(self.length,6), 'The mask must have equal amount of 1s as the degrees of freedom of the kinematic chain'
         bounds = [(link.qlim[0], link.qlim[1]) for link in self]
 
         if q0 is None: