optimization: use a tree
fix: filtered dirs didn't have full path