fix latency bug