remove potential memory leaks