add twid generate method