first memory leak fix