did some changes to ap and mobile .c to fix the problem