Add connect error handling