change the name of the variable from key to pattern