introduce some error handling for the connection