add publish event functionlity