I am trying to use a 2n2222 to drive a 5v relay to switch a 220v bulb on and off but when a was pluging it in and touched the base of the transistor to give the to complete connection I got a nasty electric shock . I tried it with other relays I had but result was same .the mains current was leaking through transistor base.
But as far as I know the to side of relay should be completely insulated.
Could anyone tell why is this happening ?
and what can I do to prevent it.
But as far as I know the to side of relay should be completely insulated.

Could anyone tell why is this happening ?
and what can I do to prevent it.