Fixed removed ap from the code