fix memory