fix typo in ap_gen