fix template instances in event handler arguments