Fixed Infinite Loop when Failed to connect to MySQL Server