fixed failover in case of connections prematurely closed by upstream