fixed pruning script