failover_flag is always false now, the variable could be removed...