fixed a couple of leaky variables