How can I create a Blueprint singleton object?

Was looking up how to create a singleton class and stumbled upon this. I implemented this in my game, but it keeps crashing on start up. Here’s my code:

UClock* UClock::getInstance()
{
static UClock* clock;
if (!clock || !IsValid(clock))
{
UClass SingletonClass = LoadClass(NULL, TEXT("/Script/ModuleName.Clock"), NULL, LOAD_None, NULL);
clock = (UClock
)ConstructObject(SingletonClass);
}
return clock;
}

So in my level blueprint, i have a variable, Clock, that i then use a Set Node connected to getInstance() function. I get an error stating that ConstructObject used a NULL object, or something. Any idea?

edit: Sorry, looks like code doesn’t work in the comments section.