added mutex around XMPP calls