fix bugs about ap