Modified for cordova 2.4.0