memory leakage fixed