added code to generate secret token