fix segfault caused by defect stack history