add some handling for connection issues