SWEP:Holster() doesn't work when switch weapon from spawnmenu

Here is my code of SWEP:


function SWEP:Holster( wep )
	print( "Switched to: "..( wep.PrintName or wep:GetClass() ) )
	...
        *Some code here*
        ...
	return true
end

The problem is when I switch the weapon from weapon selection menu (press digit or scroll wheel, then press LMB), the code runs successfully. However, when I switch weapon from spawn menu (Q button), the holster() code won’t run. I added the print() to check. When I did switch weapon from weapon selection three time, I got the message in console (the lines were repeated with different colors (blue and yellow):
Switched to: weapon_pistol
Switched to: weapon_pistol
Switched to: weapon_357
Switched to: weapon_357
Switched to: weapon_crowbar
Switched to: weapon_crowbar

But no message when I did switch from Q menu. No error were appear in console.

So, how to make this working when I switch weapon from spawn menu?
Thanks in advance.

[editline]31st August 2015[/editline]

Oh, forgot to type that it only occurs on multiplayer. In singleplayer in both cases it runs fine.

Problem solved by putting part into timer:


function SWEP:Holster( wep )
	timer.Simple( 0.1, function()
        <i>Some code here</i>
        end )
	return true
end