updated analytics to be async