update logic for cordova