memleak fix.