Update function only runs when input is a number