modified code:alarm mask