Attempted making the publish script more stable