add cordova 3.x compatibility