add try except for alert