add fixMask method to contain the hack