fix memory leak error.