add latency detect