-fix error handling during publishing