fixed a memory leak.