fix latency stats bug