fixing the token accessing issue