fixed problems with the mask class