fixed JS error for alerts.