Enhanced Connection and general error handling