Fix failover logic.
refactor: for exception