plug a memory leak