Introduced smoothing of latency value and auto-reconnect when networks comes back