fix tracking code to use async