Added correct implementation to track latency