Sockets and Animations

This is so tough figuring out, cause i have made a gun idle animation and an aim down sight animation, but the gun is linked to a socket, so when i move the socket in for example the idle animation, it also moves in the aim down sight animation. Any tips?
The hands and legs are the only bones moving in the animation, but the gun still moves due to it being linked to the socket, so when i try to make the socket fit the animation, it moves in all of them, which is not what i am trying to do