attempt to fix a memory leak