Fix alert functionality