diff --git a/mesh_relax.py b/mesh_relax.py
index 19bcc80483a885420ac2f6aa41c8539ce8ec0a2c..1b6526be32e65f7543fd6bfdf41e69b0d24c9c64 100644
--- a/mesh_relax.py
+++ b/mesh_relax.py
@@ -80,10 +80,7 @@ def relax_mesh(context):
     bpy.ops.object.mode_set(mode='OBJECT')
 
     # apply the modifier
-    # (this is temporary, applying needs to be done properly at some point)
-    C_py = bpy.types.Context.copy(context)
-    C_py["modifier"] = sw
-    bpy.ops.object.modifier_apply(C_py)
+    bpy.ops.object.modifier_apply(modifier='relax_target')
     
     # delete the target object
     obj.selected = False