fixed mem leak.