Fix publish/unpublish AJAX bug