fix error when you press tab and token id was not saved