remove a memory leak