adding authcode related functions