fixing remaining mem leaks