fix more memory leaks