Memory leak fix (potentially)