ensure we process the correct variable and also use pkgin in a less brittle way