update the pattern