working like a charm with xbee but lagging with hc-05

Wiring? There's absolutely no code that talks to the bluetooth device. It might be that you set a transparent communication on the first serial interfaces but you didn't tell us.

If the HC-05 don't work but the XBee (which XBee BTW?) does, why don't you just use the XBee?