Fixing bug on patterns storage on change listener.