fixed bug in edgeMask