add hook for publish toggle button