fixed more memory leaks