attempting to remove memory leaks