add basic event handling