Bluetooth Arduino Car won't turn

Hello everyone! I am having trouble with my rc car code :( I'm using an Uno, Dual H-Bridge Driver (generic from china), basic gearmotors, and an app that a friend built to control it forwards, backwards, left-motor-only, right-motor-only. It works fine until I go forwards or backwards for too long, and then it will not turn. Meaning, If I reset arduino, I can turn just fine, until I go forwards or backwards, then it will not turn anymore until I reset again... Below is the code I am using. I am not very good at any sort of programming and that is why I am coming to the community. Thanks a lot for any help in advance!

int motorLpin1=2;
int motorLpin2=3;
int motorRpin1=4;
int motorRpin2=5;
int motorLpwm=10;
int motorRpwm=11;

int motorSpeed=125;
int turn=125;

void setup() {
  Serial.begin(9600);
  Serial.flush();
  pinMode(motorLpin1,OUTPUT);
  pinMode(motorLpin2,OUTPUT);
  pinMode(motorRpin1,OUTPUT);
  pinMode(motorRpin2,OUTPUT);
  pinMode(motorLpwm,OUTPUT);
  pinMode(motorRpwm,OUTPUT);
}

void loop() {
  String input="";
  while(Serial.available()){
    input+=(char)Serial.read();
    delay(5);
  }
  
  if(input=="n"){
    stp();
  }
  else if(input=="F"){
    fwd();
  }
  else if(input=="R"){
    rev();
  }
  else if(input.indexOf("TL")>-1){
    lft();
  }
  else if(input.indexOf("TR")>-1){
    rght();
  }
  else if(input!=""){
    motorSpeed=input.toInt();
  }
}

void fwd(){
  analogWrite(motorLpwm,motorSpeed);
  analogWrite(motorRpwm,motorSpeed);
  digitalWrite(motorLpin1,1);
  digitalWrite(motorLpin2,0);
  digitalWrite(motorRpin1,1);
  digitalWrite(motorRpin2,0);
}

void rev(){
  analogWrite(motorLpwm,motorSpeed);
  analogWrite(motorRpwm,motorSpeed);
  digitalWrite(motorLpin1,0);
  digitalWrite(motorLpin2,1);
  digitalWrite(motorRpin1,0);
  digitalWrite(motorRpin2,1);
}

void lft(){
  analogWrite(motorLpwm,motorSpeed-turn);
  analogWrite(motorRpwm,motorSpeed+turn);
  digitalWrite(motorLpin1,1);
  digitalWrite(motorLpin2,0);
  digitalWrite(motorRpin1,1);
  digitalWrite(motorRpin2,0);
}

void rght(){
  analogWrite(motorLpwm,motorSpeed+turn);
  analogWrite(motorRpwm,motorSpeed-turn);
  digitalWrite(motorLpin1,1);
  digitalWrite(motorLpin2,0);
  digitalWrite(motorRpin1,1);
  digitalWrite(motorRpin2,0);
}

void stp(){
  analogWrite(motorLpwm,0);
  analogWrite(motorRpwm,0);
  digitalWrite(motorLpin1,1);
  digitalWrite(motorLpin2,1);
  digitalWrite(motorRpin1,1);
  digitalWrite(motorRpin2,1);
}
  Serial.begin(9600);
  Serial.flush();

Start the serial port. Then, block until all pending output data has been sent. Why? You haven't sent anything yet, so there is nothing pending.

  while(Serial.available()){
    input+=(char)Serial.read();
    delay(5);
  }

The delay is pointless. Read all the serial data that has arrived, as fast as possible. Do NOT use Strings.

It works fine until I go forwards or backwards for too long, and then it will not turn.

What is the sending app sending? It should send ONE string when you tell it to send a forward command. It should NOT keep sending the forward command.

Thanks PaulS for your reply! I will try to figure out what it sends tonight and post it here. And thank you for your other code edit suggestions!