resolve a memory leak