fix memory used