Moved purge before redirect