fix prune_installed function