Add dynamic event handling