Help with bluetooth module and motors

hi everyone.
i build a car cotrolled with serial monitor with arduino. eveything works fine, i can succesfully change directions, reverse, forward etc...
the problem is that y want to use bluetooth module HC-06 , i still using serial but with bluetooth, and i can succesfully comunicate with my android, but when i send "A" or "R"(corresponding to forward and reverse) it only work for a few sconds and then the arduino do a kind of reset (the led stay HIGH) and i have to load my sketch again.

any advice? :frowning:

const int vb=150;
const int eldelay=20;
char c ;
int MR=5,MF=6; //motor A
int MF2=9,MR2=10; //motor B
void setup()
{
Serial.begin(9600);
pinMode(13,OUTPUT);
digitalWrite(13,LOW);
}
void loop()
{
c=Serial.read();
direcc();
}
void direcc()
{
if(c=='A'){
analogWrite(MF,vb);
analogWrite(MF2,vb);
analogWrite(MR,0);
analogWrite(MR2,0);
delay(eldelay);
}
if(c=='R'){
analogWrite(MF,0);
analogWrite(MF2,0);
analogWrite(MR,vb);
analogWrite(MR2,vb);
delay(eldelay);
}
if(c=='I'){
analogWrite(MF,0);
analogWrite(MF2,vb);
analogWrite(MR,0);
analogWrite(MR2,0);
delay(eldelay);
}
if(c=='D'){
analogWrite(MF,vb);
analogWrite(MF2,0);
analogWrite(MR,0);
analogWrite(MR2,0);
delay(eldelay);
}
if(c=='S'){
analogWrite(MF,0);
analogWrite(MF2,0);
analogWrite(MR,0);
analogWrite(MR2,0);
delay(eldelay);
}
}