solve some bugs on mask