changed i = 1 to i = 0 so that no alert should fire