Update multiple packages logic to correct unset variable