added generate_token