token generation working