Rotary Encoder Issue - For FSX

I've bought an arduino mega 2560 r3 card for my FSX cockpit project, I've managed to light some leds via Link2FS and get working pushbuttons but I'm having problem with reading rotary values.

I've looked almost every rotary code on the web. With this code below, I've managed to get rotary value smoothly increased, but I couldn't send "decrease" command to the card.

Could you please help about what should I change on this code?

 #define ENC_A 51
#define ENC_B 53
#define ENC_PORT PINB
 
void setup()
{
  /* Setup encoder pins as inputs */
  pinMode(ENC_A, INPUT);
  digitalWrite(ENC_A, HIGH);
  pinMode(ENC_B, INPUT);
  digitalWrite(ENC_B, HIGH);
  Serial.begin (115200);
  Serial.println("Start");

 // enable pullup for encoder pins
  PORTD |= _BV(PORTD7) | _BV(PORTD6) | _BV(PORTD5) | _BV(PORTD4) | _BV(PORTD3) | _BV(PORTD2);

  // enable button pin change interrupt
  PCMSK2 = _BV(PCINT18) | _BV(PCINT19) | _BV(PCINT20) | _BV(PCINT21) | _BV(PCINT22) | _BV(PCINT23);
  PCICR = _BV(PCIE2);  // D-port interrupt enable
  
}
 
void loop()
{
 static uint8_t counter = 0;      //this variable will be changed by encoder input
 int8_t tmpdata;
 /**/
  tmpdata = read_encoder();
  if( tmpdata ) {
    Serial.print("Counter value: ");
    Serial.println(counter, DEC);
    counter += tmpdata;
  }
}
 
/* returns change in encoder state (-1,0,1) */
int8_t read_encoder()
{
  static int8_t enc_states[] = {0,1,0,1};
  
  
  static uint8_t old_AB = 0;
  /**/
  old_AB <<= 2;                   //remember previous state
  old_AB |= ( ENC_PORT & 0x03 );  //add current state
  return ( enc_states[( old_AB & 0x0f )]);
}