working purge on save and delete