Fixed purge logic