updated match to handle arrays