hasAlert() method added.