Improved: Connection error handling