Update connection to use cordova events