Updated event handling