added helper for returning the first match in an array