Trying to fix memory issues