Trying to fix memory leak :(