Fixing purge to happen in the correct phase