fix lastOutput when initialize a mask