fixed prune code