fixed undefined function issue when adding new token