trying to fix memory. failing