trying to fix memory issue