add latency and error eventt calls