fix closure memary leak.