Tachometer Problem

Hello guys.
I have a problem in my sketch
My tachometer works fine, but when the engine stops rotating it never shows “0” on the display. Shows always the last value read. What am I doing wrong?
Thanks,

#include <LiquidCrystal.h>
LiquidCrystal lcd(3, 5, 9, 10, 11, 12);

volatile float time = 0;
volatile float time_last = 0;
volatile int rpm_array[5] = {0,0,0,0,0};

void setup()
{
//Digital Pin 2 Set As An Interrupt
attachInterrupt(0, fan_interrupt, FALLING);

// set up the LCD’s number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print(“Current RPM:”);
Serial.begin(9600);
}

//Main Loop To Calculate RPM and Update LCD Display
void loop()
{
int rpm = 0;

while(1){

//Slow Down The LCD Display Updates
delay(500);

//Clear The Bottom Row
lcd.setCursor(0, 1);
lcd.print(" ");

//Update The Rpm Count
lcd.setCursor(0, 1);
lcd.print(rpm);
Serial.print(rpm);

////lcd.setCursor(4, 1);
////lcd.print(time);

//Update The RPM
if(time > 0)
{
//5 Sample Moving Average To Smooth Out The Data
rpm_array[0] = rpm_array[1];
rpm_array[1] = rpm_array[2];
rpm_array[2] = rpm_array[3];
rpm_array[3] = rpm_array[4];
rpm_array[4] = 60*(1000000/(time*4));
//Last 5 Average RPM Counts Eqauls…
rpm = (rpm_array[0] + rpm_array[1] + rpm_array[2] + rpm_array[3] + rpm_array[4]) / 5;
}

}
}

//Capture The IR Break-Beam Interrupt
void fan_interrupt()
{
time = (micros() - time_last);
time_last = micros();
}

It never breaks out of the while loop.

rpm_array[4] = 60*(1000000/(time*4));

If this is an arduino uno, then rpm_array is an int 16 bit, yet you have a 1000000 in there, should be 1000000L

or 1000000UL for unsigned long - it can't go negative, can it?