Is there a reason it can’t be called from Global?
There is a clearstate() function in globals that resets some of the data when loading files. There could be other issues too.