Added cordova.js back
added check for internet connection