Fixed bug with token updating