fix slave failover issue when there is only one slave