Pointshop nill value

getting this error only on my public TTT server not on private sandbox :
[ERROR] addons/pointshop/lua/cl_pointshop.lua:178: attempt to index field ‘_Hats’ (a nil value)

  1. Function - addons/pointshop/lua/cl_pointshop.lua:178
  2. unknown - lua/includes/modules/usermessage.lua:87

code:
usermessage.Hook(“PointShop_AddHat”, function(um)
local ply = um:ReadEntity()
local item_id = um:ReadString()

if not ply or not item_id then return end

local item = POINTSHOP.FindItemByID(item_id)
if not item then return end

if not ply._Hats then
	ply._Hats = {}
end

** if ply._Hats[item_id] then return end**

local mdl = ClientsideModel(item.Model, RENDERGROUP_OPAQUE)
mdl:SetNoDraw(true)

ply._Hats[item_id] = {
	Model = mdl,
	Attachment = item.Attachment or nil,
	Bone = item.Bone or nil,
	Modify = item.Functions.ModifyHat or function(ent, pos, ang) return ent, pos, ang end
}

end)

also having problems with pos and scale of items :
ModifyHat = function(ent, pos, ang)
ent:SetModelScale(1.6, 0)
ent:SetMaterial(“models/weapons/v_stunbaton/w_shaft01a”)
pos = pos + (ang:Forward() * -7) + (ang:Up() * 8)
ang:RotateAroundAxis(ang:Right(), 90)
return ent, pos, ang
end

code just dont work at all. which i think links to the code at top so both problems could be related.