fix connection error bug