refresh the value of alert so we don't always delay

The way the code was previously written the delay would always occur for the maximum amount of time because we never refresh the value of alert.  Simple fix to refresh the value of alert so we don't waste time.