update nextpattern/previouspattern