now with less memory corruption