add generatesecret method