enabled depth first matching to start from the root