Looks like you could just change $v1 to $ifmatch .. $v1 was a 6.16 addition