Add connection error handling