Added quit button, updated code to fit with latest cordova release