Clean up mask history on exit