Fix Bad connection logic.