fixed some possible memory leaks