working on memory leakage