Dc Motor Button Control Problem

Hello folks.I want to control the direction of motor with buttons.My motor turns cw but it does not turn ccw actually it is turning only one direction.Here is my code;

#include <LiquidCrystal.h>

int button1 = 10;
int button2 = 11;



//LiquidCrystal lcd(1,2,3,4,5,6);

void setup() {
  
  pinMode(button1, INPUT);
  pinMode(button2,INPUT);
  pinMode(7, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  
  //lcd.begin(16,2);
  //lcd.clear();
  
}

void loop() {
  
 
  if(digitalRead(button1) == HIGH)
  {
  digitalWrite(7, HIGH);
  digitalWrite(8, LOW);
  analogWrite(9,80);
  }
  else if(digitalRead(button2) == HIGH)
  {
  digitalWrite(7, LOW);
  digitalWrite(8, HIGH);
  analogWrite(9,80);
  }
  else
  {
  digitalWrite(7, LOW);
  digitalWrite(8, LOW);
 
}

Im driving with l298n also tried l293d but same result.

Do you have external pulldown resistors on those buttons so that you know they’ll read LOW when not pressed?

Delta_G:
Do you have external pulldown resistors on those buttons so that you know they'll read LOW when not pressed?

Yes i have.I think there is a problem with code but i could not figure it out.

Should digitalWrite(7, LOW);
be digitalWrite(7, HIGH); in the else block?