add exception handling for Publish