add rand func to generate token