add global event handler for components