properly detect connection issues and show appropriate message.