change input number handling logic