Updated for Cordova 2.6.0 by @aadel