#58, remove stale layers when switching between modes