added error for failed connection