removed alerts and wrapped analytics in try catch