actually we can drop the check for the pattern when generating, it can do no harm