set method for publish or unpublish