Initial try to fix memory leak, still present though