fix self-purge bug