Fixed by updating prune function