Creating/adding socket to a static mesh with Python

I made a script that creates StaticMeshSocket objects and adds them to a Static Mesh with some coordinates. The problem is when I reload my project I cant open my Static Mesh anymore, everything just crashes.

I assume that my Static Mesh cannot find a reference to socket objects after I restart. If so how am I supposed to save these socket objects?

Problem solved! Turns out when im creating StaticMeshSocket objects its not enough to type mySocket = unreal.StaticMeshSocket() , you have to specify your static mesh mySocket = unreal.StaticMeshSocket(outer = meshReference). Didn’t know what outer means or if it was necessary since im already referencing my mesh when I type meshReference.add_socket(mySocket).