Another attempt to fix memory issue