fixed token not updating correctly when logging in for the first time