Added reconnection code, it works but proper Xmpp cleanup needed