fixed bug with losing last digit on keypress