fixed a bug in maskBaseDepth