fixed overflow in the token generation