make  publishEvent typed