fix memory update