diff --git a/CSE/Calculation/sub_linear_regression.vb b/CSE/Calculation/sub_linear_regression.vb
index a852e4b2af40be30356a54b371062a1a3a8a95e3..08ec315d11c8aba9174e54041a3e9e94328d3a80 100644
--- a/CSE/Calculation/sub_linear_regression.vb
+++ b/CSE/Calculation/sub_linear_regression.vb
@@ -400,7 +400,7 @@
 
         ' Find the correct curve
         For i = 0 To GenShape.veh_class.Count - 1
-            If GenShape.veh_class(i) = vehicleX.classCode And CBool(GenShape.veh_conf(i)) = vehicleX.IsRigid Then
+            If GenShape.veh_class(i) = vehicleX.classCode And CBool(GenShape.veh_conf(i)) = Not vehicleX.IsRigid Then
                 pos = i
                 Exit For
             End If