Added an else to fix premature time resetting.