fixed memory leak.