tried to fix memory leak
tried to fix memory leaks