Fix KeyError in alerts implementation

- Fix for alert that wasn't dismissing after refreshing the page