fix all memory leaks