Loading xml in the main constructor is glitchy

I have a hard to track down bug. Basically, in the main class, in the constructor, I load an xml file.

Sometimes it fails to load, without giving an error. Then, when I refresh the page, it loads.

It seems like it might be some kind of race condition, but I’m not %100 sure. I though about firing the xml loading code off a timer after one second, but that seems messy. Is there a better place to put this even than the constructor? Do you think that is even the problem?