more memory leaks fixed