added directory pruning support