Trying to fix memory issue