Replace older event.type with event["type"]