managing publish  and unpublish