finished the memory leak