updating number correctly