Ent Collision

I want to remove an entity created by a SWEP when it collides with any world object. Any ideas whats wrong?


function SWEP:PrimaryAttack()

    local tr = self.Owner:GetEyeTrace()
 
    self:EmitSound(self.Primary.Sound)
    self.BaseClass.ShootEffects(self)
 
    if (!SERVER) then return end
 
    local ent = ents.Create("prop_physics")
    ent:SetModel("models/props_junk/PopCan01a.mdl")
 
    ent:SetPos(self.Owner:EyePos() + (self.Owner:GetAimVector() * 16))
    ent:SetAngles(self.Owner:EyeAngles())
    ent:SetColor(Color(233, 37, 37, 0))
    ent:SetCollisionBounds( Vector( -16, -16, -16 ), Vector( 16, 16, 16 ) )
    ent:Spawn()
    local trail = util.SpriteTrail(ent, 0, Color(0,255,0), false, 10, 5, 0.15, 1/(10+5)*0.5, "trails/plasma.vmt")
    local phys = ent:GetPhysicsObject()


    if !(phys && IsValid(phys)) then ent:Remove() return end


    phys:ApplyForceCenter(self.Owner:GetAimVector():GetNormalized() *  math.pow(tr.HitPos:Length(), 3))
     phys:EnableGravity(false)
function ent:PhysicsCollide( data, phys )
        data.HitObject:GetEntity():TakeDamage(35);
ent:Remove()
end 
self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
end