added alert dialog to gracefully exit the application if device is not connected to the internet