- fixed a  bunch of memory leaks