Adding cordova pause and resume events