Trying to stop the memory leaks