Store ItemType(itemEx.itemid) in a userdata object and use it here and in the if statement below. It would also be better to check itemEx.type before calling isFluidContainer() because it is cheaper.