tested that generate token works