fix firstmaskpos issue + fix isComplete