fixing on the fly mask change snippet