Fixed onAlert function to use titleList for alerts to be dismissed.