update publish logic