digitalWrite won't work unless i use a button connected to digital pin first

This code is working. It activates relays and toggles LED widgets. The problem is it will not set the digital pins to high or low unless I first use a button widget set to the digital pin. Then it works as expected. I have to do this each time the processor is turned off and on.

void setup()
{
  Serial.begin(38400); 
  Blynk.setDeviceName("Blynk");
  Blynk.begin(auth);
}
 
BLYNK_WRITE(V0) {
 int pinValue = param.asInt();
 if (pinValue == 1)
 {
    digitalWrite(2, HIGH);
    Blynk.virtualWrite(V1, 255);
    Blynk.virtualWrite(V2, 0);
    delay(200);
    digitalWrite(2, LOW);
  } 
}
BLYNK_WRITE(V4) {
 int pinValue = param.asInt();
 if (pinValue == 1)
 {
    digitalWrite(13, HIGH);
    Blynk.virtualWrite(V1, 0);
    Blynk.virtualWrite(V2, 255);
    delay(200);
    digitalWrite(13, LOW);
  } 
}
BLYNK_WRITE(V5) {
   int pinValue = param.asInt();
 if (pinValue == 1)
 {
    digitalWrite(12, HIGH);
    Blynk.virtualWrite(V8, 255);
    Blynk.virtualWrite(V9, 0);
    delay(200);
    digitalWrite(12, LOW);
  } 
}
BLYNK_WRITE(V10) {
   int pinValue = param.asInt();
 if (pinValue == 1)
 {
    digitalWrite(14, HIGH);
    Blynk.virtualWrite(V9, 255);
    Blynk.virtualWrite(V8, 0);
    delay(200);
    digitalWrite(14, LOW);
  } 
}
void loop()
{
  Blynk.run();
}

It probably needs a pinMode declaration in your void loop.

Pete.

thank you. I put the pinMode declaration in the void setup and it works.