removed more memory leaks