D13 as input not working

I have one project with few buttons and I am using some pins as inputs with internal pullup.
Prolem is when I use D13 immidiatelly after bootup it register D13 pin as pressed and starts to spin motor, but when I use D6 or any other pin it behaves as expected, but just on pin 13 i can't make it work.
does anyone have idea how to block whatever is happening until button press,what I need it to do.
Here is the code:

const int dirPin = 7;
const int stepperPin = 8;
const int homepolozaj = 2;
const int brzina1 = 3;
const int brzina2 = 4;
const int brzina3 = 5;
const int gore = 13;
const int dole = 6;
const int ms1 = 11;
const int ms2 = 10;
const int ms3 = 9;
byte stanje;
long brzina = 100;

void setup() {
  pinMode(A0, OUTPUT);
  pinMode(A1, OUTPUT);
  pinMode(A2, OUTPUT);
  pinMode(A3, OUTPUT);
  pinMode(ms1, OUTPUT);
  pinMode(ms2, OUTPUT);
  pinMode(ms3, OUTPUT);
  pinMode(dirPin, OUTPUT);
  pinMode(stepperPin, OUTPUT);
  pinMode(homepolozaj, INPUT); 
  digitalWrite(homepolozaj, HIGH); 
  pinMode(brzina1, INPUT);
  digitalWrite(brzina1, HIGH);
  pinMode(brzina2, INPUT);
  digitalWrite(brzina2, HIGH);
  pinMode(brzina3, INPUT); 
  digitalWrite(brzina3, HIGH);
  pinMode(gore, INPUT); 
  digitalWrite(gore, HIGH); 
  pinMode(dole, INPUT);
  digitalWrite(dole, HIGH); 
  // pocetak();
}

void loop() {
  tipkalo();

}

void pocetak() {
  digitalWrite(dirPin, LOW );
  stanje = digitalRead(homepolozaj);
  while (stanje == HIGH)
  {
    digitalWrite(stepperPin, HIGH);
    delayMicroseconds(1000);
    digitalWrite(stepperPin, LOW);
    delayMicroseconds(1000);

    stanje = digitalRead(homepolozaj);
  }
  delayMicroseconds(500);
  digitalWrite(dirPin, HIGH  );
  stanje = digitalRead(homepolozaj);
  while (stanje == LOW)
  {
    digitalWrite(stepperPin, HIGH);
    delayMicroseconds(1000);
    digitalWrite(stepperPin, LOW);
    delayMicroseconds(1000);

    stanje = digitalRead(homepolozaj);
  }
}

void tipkalo() {
  if (digitalRead(brzina1) == LOW) {
          brzina = 36999;
          digitalWrite(ms1, LOW);
          digitalWrite(ms2, HIGH);
          digitalWrite(ms3, HIGH);
          digitalWrite(A0, HIGH);
          digitalWrite(A1, LOW);
          digitalWrite(A2, LOW);
  }
  else if (digitalRead(brzina2) == LOW) {
          brzina = 24000;
          digitalWrite(ms1, LOW);
          digitalWrite(ms2, HIGH);
          digitalWrite(ms3, LOW);
          digitalWrite(A0, LOW);
          digitalWrite(A1, HIGH);
          digitalWrite(A2, LOW);
  }
  else if (digitalRead(brzina3) == LOW) {
          digitalWrite(A2, HIGH);
          brzina = 10000;
          digitalWrite(ms1, LOW);
          digitalWrite(ms2, HIGH);
          digitalWrite(ms3, LOW);
          digitalWrite(A0, LOW);
          digitalWrite(A1, LOW);
  }
  else if (digitalRead(dole) == LOW) {
    digitalWrite(dirPin, HIGH );
    stanje = digitalRead(homepolozaj);
    while (stanje == HIGH)
    {
      digitalWrite(stepperPin, HIGH);
      delayMicroseconds(1000);
      digitalWrite(stepperPin, LOW);
      delayMicroseconds(1000);

      stanje = digitalRead(homepolozaj);
    }
    delayMicroseconds(500);
    digitalWrite(dirPin, LOW  );
    stanje = digitalRead(homepolozaj);
    while (stanje == LOW)
    {
      digitalWrite(stepperPin, HIGH);
      delayMicroseconds(1000);
      digitalWrite(stepperPin, LOW);
      delayMicroseconds(1000);
      stanje = digitalRead(homepolozaj);
    }
  }

}

D13 is often connected directly to an LED/resistor, and may not work well as input.

It itsn't working at all as input.
can I use a4 as digital input, for button press

chuspy:
It itsn't working at all as input.
can I use a4 as digital input, for button press

Yes, as long as the I2C is not in use, for boards that have I2C on A4/A5.

So internal pullup's are working on analog same as on digital and just I use a04 as pin number instead of 13?

It is clone of Nano v3 so I think there is no I2C

chuspy:
So internal pullup's are working on analog same as on digital and just I use a04 as pin number instead of 13?

It is clone of Nano v3 so I think there is no I2C

The Nano has I2C. But the question is not whether the board has it, but whether you are using I2C. You can not get away with wild names for pins. a04 is not an acceptable name for A4.

The pins A4 and A5 are multipurpose. You can use them as analog inputs, digital I/O, or I2C.