update subscribe/publish logic