save/restore when toggling run mode