changing middleware pub/sub example