modified to work for Generate Token