fix memory issue.