ensure the correct list of packages is referenced when removing packages