(Solved) ir remote relay control

i'm not really sure how to use that type of sketch set up, this ir stuff has me baffled too. i tried the else if once before and it didn't work but now i got it working except after i turn on any of the 4 relays i can turn on and off the first relay with a single button press but after it on, turning on the other 3 takes two button presses just to turn on. i'm pretty sure its miss placement of the irrecv.resume(); command but i'm not really sure where i need to put it. i tried putting it at the end of every (else if) statement but then the whole thing doesn't work. where i have it in this code is the only way i found so far that gives me close to perfect output results

#include <IRremote.h>

int RECV_PIN = 11;
int relay1 = 2;
int relay2 = 3;
int relay3 = 4;
int relay4 = 5;

IRrecv irrecv(RECV_PIN);
decode_results results;

void setup()
{
  pinMode(relay4, OUTPUT);
  pinMode(relay3, OUTPUT);
  pinMode(relay2, OUTPUT);
  pinMode(relay1, OUTPUT);
  pinMode(13, OUTPUT);
  irrecv.enableIRIn(); // Start the receiver
}

int on = 0;
unsigned long last = millis();

void loop() {
  if (irrecv.decode(&results)) {
    if (results.value == 0xF171) { // Remote Control Power Code
      // If it's been at least 1/4 second since the last
      // IR received, toggle the relay
      if (millis() - last > 250) {
        on = !on;
        digitalWrite(relay1, on ? HIGH : LOW);
      }
      last = millis();
    }    
    irrecv.resume(); // Receive the next value
    
  }
  
  else if (results.value == 0xF1B1) {
  if (millis() - last > 250) {
    on = !on;
    digitalWrite(relay2, on ? HIGH : LOW);
  }
  last = millis();
 
   
}


else if (results.value == 0xF1A1) {
  if (millis() - last > 250) {
    on = !on;
    digitalWrite(relay3, on ? HIGH : LOW);
  }
  last = millis();

  
  
}


else if (results.value == 0xF121) {
  if (millis() - last > 250) {
    on = !on;
    digitalWrite(relay4, on ? HIGH : LOW);
  }
  last = millis();
  
}
}