Add custom event handler