Added network status checking and an alert dialog if there is no network