The millis() does a rollover from 0xFFFFFFFF to 0x00000000 after about 50 days. To avoid problems, store a millis value always as unsigned long and subtract it with "currentMillis - previousMillis". That substraction with both being unsigned long will result in a valid number, even if millis() is in the middle of a rollover.