Fixed exception when connecting during failover