fixed error with AP