added support for latency compensation