update value on keypress