Another attempt at memory fix