a memory leak fix