trying to fix memory leaks
trying to fix memory leaks