fixed undefined bug for value[key] in matches