fix cast exception for context menu with TaggedEvent