break void function when the condition is met

outsider:
Do you have a pulldown resistor(10k) on pin 2?
Where do you turn the LEDs LOW?

yes ,there is a 10k resistor parallel with push button