fixed some more memory leaks