fix alert trigger function