real fix for corruption (use-after-free).