Add a alert eventhandler