Added functionality to display error message if there is no internet connection and added tests around thiis