fix an memory leak (hopefully...)