fix memory leak problem.