on the way to fix memory errors