cleaned up auto_publish to be cleaner