updated mixpanel code