add mac_gen stuffs