memory leak initial fix