update example so it finishes correctly even if some messages fail