Tried implementing that as shown in the screenshot and it has led to an additional error, which I think has appeared before around one of the character movement screenshots. I also tried changing the inventory ref to a set rather then a get to the same effect.