Fixing newval undefined sometimes.