Problems implementing "Undo" on my plugin

Hi, I’m trying to build a plugin working with the SplineComponent module and I’m having a lot of trouble trying to make the Undo command work with it. I’m calling Modify() everytime my Custom SplineComponent is changed and the weird part is that it’s working but just once. If I try to undo 2 actions in a row the engine crashes.
The line responsible for the crash is:

check(!EditReregisterContexts.Find(this));

at the UActorComponent::PreEditChange method.

By debuging the code I was able to find out that the PreEditChange() method is being called twice, once for my own component and once for a RootComponent which I suppose is the parent actor for my component. And when I try to undo the action, the engine crashes because it wasn’t supposed to be called twice.

I have no idea why it’s being called twice though. Already checked if my Modify() method is being called more times than it should and apparently it’s not.

Any help is appreciated, thanks.