Fixing a bug with purge records