update code when a letter is changed