fixed memory leak
merge