memory leak on exit fix and comment