implement an unpublish method with callbacks