added latency check