fixed the token function in the shell class