update mask, fix issues