created function to execute once a value is matched