Tried to fix memory leak