LedControl delay problem?

Probably should have posted this in this forum...

I have a MAX7219 wired up to a Mega and it's works, but after I let the pin go low it takes about 2-3 seconds for the display to turn off, like it keep looping though the code after the pin goes low. Here is my code, any ideas? I did have a pull up resistor, no effect, it's always the same amount of time every time.

#include "LedControl.h"

LedControl lc=LedControl(44,46,45,1);

void setup() {

  lc.shutdown(0,false);
  lc.setIntensity(0,1);
  lc.clearDisplay(0);
}

void light() {
  
  byte z[8]={B10101010,
             B01010101,
             B10101010,
             B01010101,
             B10101010,
             B01010101,
             B10101010,
             B01010101};
  
  lc.setRow(0,0,z[0]);
  lc.setRow(0,1,z[1]);
  lc.setRow(0,2,z[2]);
  lc.setRow(0,3,z[3]);
  lc.setRow(0,4,z[4]);
  lc.setRow(0,5,z[5]);
  lc.setRow(0,6,z[6]);
  lc.setRow(0,7,z[7]);

}

void loop() { 

  
  if (digitalRead(3)==HIGH)
    {
      light();
    }
  else
    {
    lc.clearDisplay(0);
    }
    
}

Do you have a pulldown resistor on pin3 to ensure it goes low when released?

(Do you have this posted elsewhere? Seems like I responded to this already)

Yes I figured I posted in the wrong forum. I did have a pulldown resistor.