aparfeno:
I am powering the relay module independently from arduino (although i have common ground)
Then you don't have opto isolation.
To opto isolate a relay module, remove the JD-VCC jumper,
and power the relay (coils) with a separate 5volt supply on the JD-VCC (not VCC) and ground pins.
Connect VCC and the INs to the Arduino, but NOT RELAY GROUND.
A snubber circuit across the relay contacts (AC power) or diode across the solenoid (DC power) might be needed to kill EMI.
As larryd said, post a full diagram, and code. There might be more wrong
Leo..
Opto isolation is for mains power safety or to eleminate ground loops.
Snubbering is for killing EMI.
Sometimes you need one, sometimes you need the other, sometimes you need both.
Explaining why to a newbie is usually harder than to advice to use both.
Leo..