define throwEvent as extern