added support for mask layer