Added exception handling too setLayerSetMask