Bluetooth HC-05 connection

hello, i have some problems communicating two arduino boards with bluetooth HC-05. What i'm gonna do is when i press a button on board A then the led on Board B will light up. The problem is when i press the button, nothing happens. Can someone check whether is my code correct?

Board A (Master)

int buttonPin = 6;
int dataSlave = 0;
int buttonState = 0;
int led = 7;
void setup() 
{
   pinMode (buttonPin, INPUT);
   pinMode (led, OUTPUT);
   Serial.begin(38400);
}
void loop()
{
  buttonState = digitalRead(buttonPin);
  if(Serial.available() > 0){
    dataSlave = Serial.read();
  }
 
  if (buttonState == HIGH){
    Serial.write('4');
    digitalWrite(led, HIGH);
    Serial.println(dataSlave);
  }else{
    Serial.write('5');
    digitalWrite(led, LOW);
  }
  delay(10);
}

Board B (Slave)

#define led 7
int dataMaster = 0;
void setup() 
{
   pinMode (led, OUTPUT);
   Serial.begin(38400);
}
void loop()
{
  if(Serial.available() > 0){
    dataMaster = Serial.read();
    Serial.println(dataMaster);
  }
 
  if (dataMaster == '4') {
    digitalWrite(led, HIGH);
  }else if (dataMaster == '5'){
    digitalWrite(led, LOW);
    
  }
}

YRLooi:
Can someone check whether is my code correct?

Board A (Master)

Serial.begin(38400);
}

Have both the HC-05s been reconfigured to run at 38400?

@YRLooi

Other posts/duplicates DELETED
Please do NOT cross post / duplicate as it wastes peoples time and efforts to have more than one post for a single topic.

Continued cross posting could result in a time out from the forum.

Could you also take a few moments to Learn How To Use The Forum.
It will help you get the best out of the forum in the future.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.