setPattern, enable, disable method added.