error connect handling