Fixed is_failed to check exit status