memory leaks fixes