porting to cordova 3.0