Horrible hacking to get code working with Xmpp sync