Added stencil check and activation method.