fix AccessViolationException