Made is_failed more safe