fixed the bug of an unreference leak.