Updating XMPP file to check if connection obj is null