bug fixed for pruning