no longer leak memory on shutdown