handle connecting failure more gracefully