memory leaks removed