fix switching between masks after delete or backspace