try catch block around scripts, phonegap.js instead of cordova.js