Modify run_ap() to beap()