adding events into plugin