diff --git a/cost_function.py b/cost_function.py
index ac0bbc0824f6c0cca65845f584ee0348eccc26af..df46b605211949f6a3d5e910f9f439a7f6bb40e1 100755
--- a/cost_function.py
+++ b/cost_function.py
@@ -48,9 +48,9 @@ def calculate_radii_rossby(list_eddies, e_overestim, handlers, array_d_init):
         # get the radius and the rossby number:
         shapeRec = handlers[i_SHPC]["readers"]["extremum"].shapeRecord(ishape)
         f = 2 * Omega * math.sin(math.radians(shapeRec.shape.points[0][1]))
-        V_max = shapeRec.record[4] # in m/s
+        V_max = shapeRec.record.speed # in m/s
         radius = handlers[i_SHPC]["readers"]["max_speed_contour"]\
-            .record(ishape)['r_eq_area'] * 1000 # in m
+            .record(ishape).r_eq_area * 1000 # in m
 
         if abs(V_max) < 100:
             avg_Rossby += V_max / (f * radius)