fix token generation

it now successfully connects to the server