add events and pubsub example