updated for cordova