fix leaking var