Fixing the purge method